<!DOCTYPE html>
<html lang="en">
<script src="/resources/js/jquery-1.7.1.min.js" type="application/javascript"></script>
<script src="/resources/js/jquery-ui-1.8.10.custom.min.js" type="text/css"></script>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        ul li{

            list-style: none;

        }
        .im-page{
            width: 441px;
            overflow: hidden;
            margin: 0 auto;
            margin-top: 25px;
        }
        .im-page li{
            float: left;
            height: 25px;
            line-height: 25px;
            text-align: center;
        }
        .im-page li a{
            border-right: 1px solid #ff6500;
            padding: 5px 7px;
            color: #ff6500;
            margin-left: 20px;/*设置标签 a 之间的间隔*/
            text-decoration: none;/*去除页码数字下面的下划线*/
            width: 200px;
        }
        .im-table{
            border: 1px solid #ddd;
            width:1300px;
            height:600px;
        }
        .biao{
            border:1px solid #333;
            border-collapse:collapse;
            width:1300px;
            /*height:340px;*/
        }
        .im-table{
            position: absolute;
            left: 230px;
            top: 135px;
        }
        .im-page{
            position: absolute;
            left: 1200px;
            top: 70px;
        }
        .hao{
            position: absolute;
            left: 200px;
            top: 10px;
        }

        table{border-collapse:collapse} /*合并间距*/
        table,table th,table td{border:1px solid #ddd} /*表格带线框,6像素的间距*/
        table th,table td{padding:6px} /*单元格6像素的间距*/
        table th{background-color:#eee} /*表头带背景色*/
    </style>
    <script>
        $(function () {
            chaxun(1);
        })
        function chaxun(pageNum) {
            if(pageNum==0){
                pageNum=1;
            }
            var formData=$("#form1").serialize();
            formData+="&pageNum="+pageNum;
            console.log(formData);
            $.ajax({
                url:"/findAll",
                data:formData,
                dataType:"json",
                type:"post",
                success:function (data) {
                    console.log(data)
                    var tbody='';
                    var list=data.list;
                    $("#tbody").empty();
                    for (var i=0;i<list.length;i++){
                        var smp=list[i];
                        for (b=0;b<smp.length;b++){
                            if(smp[b]==null && smp[b].equals("")){
                                smp[b]="";
                            }
                        }
                        var zt="";
                        if(smp.transaction==1){
                            zt="正常";
                        }else {
                            zt="交易暂停"
                        }
                        console.log(smp);
                        tbody+='<tr>' +
                            '        <td><input class="testyangpin" value="754" type="checkbox">'+smp.id+'</td>\n' +
                            '            <td class="ybbh">'+smp.serialNumber+'</td>' +
                            '            <td >'+smp.commonName+'</td>' +
                            '            <td >'+smp.dosageForm+'</td>' +
                            '            <td >'+smp.size+'</td>' +
                            '            <td >'+smp.unit+'</td>' +
                            '            <td >'+smp.factor+'</td>\n' +
                            '            <td >'+smp.drugCategory+'</td>' +
                            '            <td >'+zt+'</td>' +
                            '            <td><a href="editIM.html">详情</a></td>' +
                            '</tr>'
                    }
                    $("#tbody").append(tbody);
                }
            })
        }
    </script>
</head>
<body>
<div class="sousuo">
    <form class="form-b" action="" method="post" id="form1">
    <div class="hao">
        药品品目号：<input type="text" name="serialNumber" />
    </div>
    <div class="tongyongming">
        通用名：<input type="text" name="commonName" />
    </div>
    <div class="jixing">
        剂型：<input type="text" name="dosageForm" />
    </div>
    <div class="guige">
        规格：<input type="text" name="size" />
    </div>
    <div class="danwei">
        单位：<input type="text" name="unit" />
    </div>
    <div class="xishu">
        转换系数：<input type="text" name="factor" />
    </div>
    <div class="leibie">
        药品类别：<select name="drugCategory" class="province" id="leibie" onclick="changeCity()" >
                    <option value="">请选择</option>
                  </select>
    </div>
    <div class="zhungtai">
        转换状态：<select name="transaction" class="province" id="zhuangtai" onclick="changeCity()" >
                    <option value="">请选择</option>
                  </select>
    </div>

    <div class="anniu">
        <input type="submit" value="Submit" />
        <input type="submit" value="Submit" />
    </div>
    </form>
</div>
<div class="im-table">
    <table class="biao">
        <thead>
        <tr>
            <th class="w1"><input type="checkbox" id="checkbox1" value="">
                全选</th>
            <th class="w2">药品品目号</th>
            <th class="w3">通用名</th>
            <th class="w4">剂型</th>
            <th class="w5">规格</th>
            <th class="w6">单位</th>
            <th class="w7">转换系数</th>
            <th class="w7">药品类别</th>
            <th class="w7">转换状态</th>
            <th class="w7">详细</th>
        </tr>
        </thead>
        <tbody id="tbody">
        <tr >
            <td><input class="testyangpin" value="754" type="checkbox"></td>
            <td class="ybbh">ghjghjghj</td>
            <td >ghjghjghj</td>
            <td >ghjghjghj</td>
            <td >ghjghjghj</td>
            <td >ghjghjghj</td>
            <td >ghjghjghj撒分身乏术发撒肥萨法阿萨</td>
            <td >ghjghjghj</td>
            <td >ghjghjghj</td>
            <td><a href="editIM.html">详情</a></td>
        </tr>
        </tbody>
    </table>
</div>
<div class="im-page">
    <ul id="pages">
        <li class="im-indexpage"><a href="">首页</a></li>
        <li class="im-nextpage"><a href="">上一页</a></li>
        <li class="im-nextpage"><a href="">下一页</a></li>
        <li class="im-indexpage"><a href="">尾页</a></li>
    </ul>
</div>



</body>
</html>